<template>
	<view class="w100 h100">
		<view class="w100 h100">
			<view class="card c3 mb10 cshow" v-for="(form,index) in orderList" :key="index" @click="toDtail(form)">
				<view class="bd1 dfa pb10">
					<view class="f-c-s f-1">
						<view class="c0 dfa">
							<text class="f24 wei6 mr10">{{form.typeFormat}}</text>
							<text class="f12 f-1">品牌:{{form.drink && form.drink.name}}</text>
						</view>
						<view class="f10 c6 mt5" v-if="form.type==1">寄存时间:{{form.created_at}}</view>
						<view class="f10 c6 mt5" v-else-if="form.type==2">取出时间:{{form.created_at}}</view>
					</view>
					<view class="f-c-e wei6">
						<view>
							<view class="c0 mt5" v-if="form.user && form.user.mobile">尾号{{form.user.mobile.substr(form.user.mobile.length-4)}}</view>
						</view>
						<text class="f10 p5 c9 bf8 mt5">{{form.stateFormat}}</text>
					</view>
				</view>
				<!-- <view class="mt10 f-bt bd1 pb10" v-if="form.user">
					<view class="dfa f-g-1">
						<view class="f-e-c">
							<text class="c3">{{form.user.nickname}}</text>
							<text class="f10 c9 mt5">{{form.user.mobile}}</text>
						</view>
					</view>
					<view class="f-g-0 mr10" @click.stop="tocenter(form.user.mobile)">
						<u-icon name="phone-fill" color="#000" size="30"></u-icon>
					</view>
				</view> -->
				<view class="mt10 f-s bf8 p10 bs6 mb10 f12" style="background: #F6F6F6;">
					<view>
						<!-- <view class="mb5 c6">联系人 <text class="ml10 c0 wei">{{form.contacts}}</text></view>
						<view class="mb5 c6">联系电话 <text class="ml10 c0 wei">{{form.mobile}}</text></view>
						<view class="mb5 c6">过期时间<text class="ml10 c0 wei">{{form.expiredTime}}</text></view> -->
						<view class="mb5 c6" v-if="form.type==1">寄存数量<text class="ml10 c0 wei">{{form.num}} {{form.drink && form.drink.unit}} {{form.drink && form.drink.name}}</text></view>
						<view class="mb5 c6" v-else-if="form.type==2">取出数量<text class="ml10 c0 wei">{{form.num}} {{form.drink && form.drink.unit}} {{form.drink && form.drink.name}}</text></view>
						<view class="mb5 c6">寄存剩余<text class="ml10 c0 wei">{{form.residue}} {{form.drink && form.drink.unit}} {{form.drink && form.drink.name}}</text></view>
					</view>
				</view>
				<view class="dfbc">
					<view class="f12">
						<view class="mb5">操作人：<text v-if="form.admin">{{form.admin.nickname}}</text></view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			orderList: {
				type: Array,
				default () {
					return []
				}
			},
			current: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				subColor: uni.getStorageSync('subject_color'),
			}
		},
		methods: {
			tocenter(e) {
				uni.makePhoneCall({
					phoneNumber: e
				});
			},
			toDtail(v) {
				return
				uni.navigateTo({
					url: `/pages/order/detail?id=${v.id}`
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
</style>